<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="js/jquery-1.8.2.min.js"></script>

<body>
<button onclick="sendAjax()">点击发送ajax请求</button>
</body>

<script>
    function sendAjax() {
        $.ajax({
            url:"http://localhost:8080/restful/getMsg",
            type:"get",
            success:function (result) {
                alert(result)
            }
        })
    }
</script>
</body>
</html>